<template>
	<custom-page title="账号安全" backgroundColor="#F9F9F9">
		<template #page>
			<view class="page-content">
				<view class="item-row" @click="writeOffClick">
					<view class="title">账号注销</view>
					<image :src="asserts.ic_arrow_right"/>
				</view>
				<view class="log-out" @click="logOutClick">退出登录</view>
			</view>
		</template>
	</custom-page>
</template>

<script>
	import {
	 storageTokenKey
	} from '../../global/config.js'
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			writeOffClick(){
				uni.navigateTo({
					url: '/pages/account-write-off/account-write-off'
				})
			},
			
			//退出登录
			logOutClick(){
				uni.showModal({
					title: '确定退出吗？',
					success: (modal) => {
						if (modal.confirm) {
							uni.setStorageSync(storageTokenKey, '')		//用户类型 1 - 普通用户 2 - 助教用户
							uni.reLaunch({
								url: '/pages/index/index'
							})
						}
					}
				})
			}
		}
	}
</script>

<style scoped lang="less">
	.page-content{
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;
	}
	.item-row,
	.log-out{
		width: 100%;
		height: 100rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		padding: 0 32rpx;
		box-sizing: border-box;
		margin-top: 16rpx;
		background-color: white;
		.title{
			flex: 1;
			font-size: 28rpx;
			color: #585F70;
		}
		image{
			width: 20rpx;
			height: 21rpx;
		}
	}
	.log-out{
		font-size: 28rpx;
		color: #ED3C3D;
		text-align: center;
	}
</style>
